// custom-tab-bar/index.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    index1: 0,

    "list": [{
        "text": "推荐",
        "pagePath": "/pages/tuijian/tuijian"
      },
      {
        "text": "频道",
        "pagePath": "/pages/pindao/pindao"
      },
      {
        "text": "我的",
        "pagePath": "/pages/my/my"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  attached() {
    this.setData({
      index1: app.globalData.index,
    })
  },
  methods: {
    foo(event) {
      let path = event.target.dataset.path;
      let index = event.target.dataset.index;
      app.globalData.index=index;
      wx.switchTab({
        url: path,
      });
    }
  }
})